import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

// vue-router 定义一个简单路由
// 路由配置
const routes = [
  { path: '/', redirect: '/test/test-persons' },
  { path: '/login', component: () => import('@/pages/login/index.vue') },
  {
    path: '/test',
    component: () => import('@/components/layout/index.vue'),
    redirect: '/test/test-persons',
    children: [
      { path: 'test-modal', component: () => import('@/pages/test-modal/index.vue') },
      { path: 'test-table', component: () => import('@/pages/test-table/index.vue') },
      { path: 'test-form', component: () => import('@/pages/test-form/index.vue') },
      { path: 'test-request', component: () => import('@/pages/test-request/index.vue') },
      { path: 'test-pagination', component: () => import('@/pages/test-pagination/index.vue') },
      { path: 'test-dropdown', component: () => import('@/pages/test-dropdown/index.vue') },
      { path: 'test-message', component: () => import('@/pages/test-message/index.vue') },
      { path: 'test-persons', component: () => import('@/pages/persons/index.vue') },
    ],
  },

]
// 创建路由实例
const router = createRouter({
  history: createWebHashHistory(),
  routes,
})
export default router
